/*
 * @Description: 
 * @Author: Haor
 * @Date: 2022-02-22 08:56:32
 * @LastEditTime: 2022-04-28 20:19:48
 * @LastEditors: Haor
 */
import { findObjectKey } from './data'

/**
 * 获取当前设备系统
 * @return {String} sysName
 */
export const checkSystem = () => {
    const u = navigator.userAgent
    const checkSystemsMaps = {
        android: () => u.includes('Android') || u.includes('Linux'),
        ios: () => !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
    }
    return findObjectKey(checkSystemsMaps, val => val(), null)
}
